-
-
Notifications
You must be signed in to change notification settings - Fork 171
feat: adopt new HTTP layer from OpenAPIRuntime and migrate Functions to it #766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
grdsdev
wants to merge
16
commits into
main
Choose a base branch
from
new-http-layer
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pull Request Test Coverage Report for Build 16836901907Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
316e7bc
to
bfcc4cf
Compare
# Conflicts: # Package.resolved
bfcc4cf
to
8196dce
Compare
- Move FetchTransportAdapter from Functions to Sources/Helpers/HTTP/ - Remove duplicate implementation from FunctionsClient - Keep package visibility for sharing across modules - Enables reuse for other module migrations in future PRs 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
This PR introduces a major architectural change by adopting the OpenAPIRuntime HTTP layer and migrating the Functions client to use it. This addresses issue #634.
What is the current behavior?
What is the new behavior?
Core HTTP Layer (
Sources/Helpers/HTTP/
)Client
struct using OpenAPIRuntime'sClientTransport
protocolAuthClientTransport
for automatic Bearer token injectionFunctions Client Migration
FunctionsClient
from fetch-based to OpenAPIRuntime transportFetchTransportAdapter
to maintain compatibility with existing fetch handlersFetchTransportAdapter
to Helpers module for reuse across other client migrationsDependencies Added
swift-openapi-runtime
: Core HTTP transport abstractionsswift-openapi-urlsession
: URLSession-based transport implementationswift-log
: Structured logging supportswift-collections
: Enhanced collection typesTesting & Integration
FunctionsIntegrationTests
with local Supabase setupInfrastructure
Key Files Changed
Sources/Helpers/HTTP/Client.swift
: New standardized HTTP clientSources/Helpers/HTTP/LoggingMiddleware.swift
: HTTP request/response loggingSources/Helpers/HTTP/FetchTransportAdapter.swift
: Shared adapter for legacy fetch handlers (moved from Functions)Sources/Supabase/AuthClientTransport.swift
: Auth-aware transport wrapperSources/Functions/FunctionsClient.swift
: Migrated to new HTTP layerTests/IntegrationTests/FunctionsIntegrationTests.swift
: New integration test suitePackage.swift
: Added OpenAPIRuntime and supporting dependenciesBenefits
This change lays the foundation for migrating other clients (Auth, Storage, PostgREST, etc.) to the same standardized HTTP layer.